user = input("username：")
pwd = input("password:")

f = open("userinfo", "a+", encoding="utf-8")
f.seek(0)
# for i in f:
#     file_user, file_pwd = i.split(":")
#     if user == file_user:
#         print("用户已存在")
#     else:
#         print("可以注册！")

for i in f:
    file_user, file_pwd = i.split(":")
    if user == file_user:
        print("用户已存在")
        break
else:
    print("可以注册！")